#include<stdio.h>
#include"config.h"

#include "pool.h"
#include "query.h"

using namespace pqxx;
using namespace std;

int f()
{   Config c = Config();
    c.host = "dada";
    return 0;
}

int main()
{   f();
    Config c;
    c.user = "postgrefs";
    c.password = "postgrefs";
    c.port = "5432";
    c.database = "postgrefs";
    c.host = "localhost";

    system("psql -U postgrefs <postgrefs.sql");

    ConnectionPool pool(c);

    connection* my_conn = pool.get_connection();

    PostgreDB::query_mknod(my_conn, "/", S_IFDIR|0777, 0,  0);
    PostgreDB::query_mknod(my_conn, "dada", S_IFDIR|0777, 0,  PostgreDB::query_id(my_conn, "/"));
    PostgreDB::query_mknod(my_conn, "dadasd", S_IFREG|0777, 0,  PostgreDB::query_id(my_conn, "/") );
    PostgreDB::query_mknod(my_conn, "bla", S_IFREG|0777, 0,  PostgreDB::query_id(my_conn, "/dada") );

    return 0;
}

